package com.macro.mall.service;

import com.macro.mall.common.exception.XhsApiException;
import com.macro.mall.model.request.AuthTokenRequest;
import com.macro.mall.model.response.AuthTokenResponse;
import com.macro.mall.model.response.PreAuthCodeResponse;

public interface XhsLoginService {


      /**
              * 获取当前有效的access_token
     */
    String getValidToken() throws XhsApiException;

    /**
            * 强制刷新access_token
     */
    void refreshToken() throws XhsApiException;



    /**
     * 获取授权调用凭证
     * @param request 包含授权码的请求
     * @return 授权凭证响应
     * @throws Exception 异常
     */
    AuthTokenResponse getAuthToken(AuthTokenRequest request) throws Exception;



    /**
     * 获取预授权码
     * @return 预授权码响应
     * @throws Exception 异常
     */
    PreAuthCodeResponse getPreAuthCode() throws Exception;
}
